import {observable,action,computed} from 'mobx'
import { ajax } from '../api';

class User{
    @observable userList:any=null;
    @observable userList_filter:any=null;


    @action getUserList=async()=>{
        let res=await ajax.userlist()
        res.code=200&&(this.userList=res.result)
        
    }
    @action changeuser= (payload:any) =>{
        this.userList = payload;
    }

    @action filterUserList=async(payload:any)=>{
        let res=await ajax.userlist()
        res.code=200&&(this.userList_filter=res.result.filter((v:any)=>v._id!=payload))
        
    }
 
}

export default new User() 